package com.yjian.controller.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Created by 许小宝 on 2017/9/27.
 */
@Data
public class SaveMemberRequest {
    @NotEmpty(message = "请输入手机号")
    @Length(min = 11, max = 11, message = "请输入正确的手机号")
    private String phone;

    @NotEmpty(message = "请输入会员姓名")
    @Length(max = 50, message = "会员名过长")
    private String username;

    @NotNull(message = "余额不能为空")
    @Min(value = 0, message = "余额不能为负")
    private Double balance;

    @NotNull(message = "余次不能为空")
    @Min(value = 0, message = "余次不能为负")
    private Integer number;
}
